package com.huaweicloud;

import com.huaweicloud.commons.pojo.OBSStorageParams;
import com.huaweicloud.commons.response.Result;
import com.huaweicloud.config.MultipartSupportConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;


@FeignClient(value = "OBS-STORAGE", configuration = {MultipartSupportConfig.class})
public interface OBSStorageFeign {

    @PostMapping(value = "/obs/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    String upLoadOneFile(@RequestPart("file") MultipartFile file, @RequestParam("obsParamsJson") String obsParamsJson);

    @PostMapping("/obs/delete")
    Result deleteOneFile(@RequestBody OBSStorageParams obsParams, @RequestParam("deleobjectname") String deleobjectname);
}

